<template>
  <li
    class="dropdown-option"
    :class="{ 'is-disabled': disabled }"
    @click="handleClick"
  >
    <slot></slot>
  </li>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import bus from '@/plugins/bus'
export default defineComponent({
  name: 'DropdownItem',
  props: {
    disabled: {
      type: Boolean,
      default: false
    }
  },
  setup() {
    const handleClick = () => {
      bus.emit('dropdown-item-click', false)
    }
    return {
      handleClick
    }
  }
})
</script>
<style>
.dropdown-option.is-disabled * {
  color: #6c757d;
  pointer-events: none;
  background-color: transparent;
}
</style>
